/*
* @Author: 0x9DEFA478
* @Date: 2021-07-28 16:56:58
 * @LastEditTime: 2024-09-22 21:05:44
 * @LastEditors: 0x9DEFA478
* @Description: 
* QQ:2652450237
* ============================================================================================================================================
* 
* 
* 
*                                                                                               ************      ****************************
*                                                                                             ************      ****************************  
*                                                                                           ************      ****************************    
*                                                                                         ************      ****************************      
*                                                                                       ************      ************                        
*                                                                                     ************      ************                          
*                                                                                   ************      ************                            
*                                                                                 ************      ************                              
*                                                                               ************      ************                                
*                                                                             ************      ************                                  
*                                                                           ************      ************                                    
*                                                                         ************      ************                                      
*                                                                       ************      ************                                        
*                                                                     ************      ************                                          
*                                                                   ************      ************                                            
*                                                                 ************      ************                                              
*                                                               ************      ************                                                
*                                                             ************      ************                                                  
*                                                           ************      ************                                                    
*                                                         ************      ************                                                      
*                                                       ************      ************                                                        
*                                                     ************      ************                                                          
*                                                   ************      ************                                                            
*                                                 ************      ************                                                              
*                                               ************      ************                                                                
*                                             ************      ************                                                                  
*                                           ************      ************                                                                    
*                                         ************      ************                                                                      
*                                       ************      ************                                                                        
*                                     ************      ************                                                                          
*                                   ************      ************                                                                            
*                                 ************      ************                                                                              
*                               ************      ************                                                                                
*                             ************      ************                                                                                  
*                           ************      ************                                                                                    
*                         ************      ************                                                                                      
*       ****************************      ************                                                                                        
*     ****************************      ************                                                                                          
*   ****************************      ************                                                                                            
* ****************************      ************                                                                                              
* 
* 
* 
* ============================================================================================================================================
* 
*/
#include "Peripheral.h"
#include "app_main.h"


H_TS_Thread* app_thread;

/**
 * @brief 开始线程方法
 * @param v ...
 * @return 0
 */
int Thread_Start(void* v){
  H_TS_ThreadAttribute ThreadAttribute=vH_TS_ThreadAttributeDefault;

  //初始化外设
  Peripherals_Init();
  

  ThreadAttribute.Priority=vapp_main_Priority;
  ThreadAttribute.ThreadName="app_main";
  app_thread=H_TS_StartNewThread(app_main,NULL,&ThreadAttribute);
    
  //结束线程
  return 0;
}


static void IdleProcess(void* v){
  // __WFI();
}

/**
 * @brief 初始化入口
 * @return 无
 */
void Entry(){
  H_TS_ThreadAttribute ThreadAttribute=vH_TS_ThreadAttributeDefault;

  H_TS_SetIdleProcess(IdleProcess);

  //初始化启动线程之前需要初始化的外设
  Peripherals_SysInit();

  ThreadAttribute.ThreadName="Thread_Start";
  H_TS_StartNewThread(Thread_Start,NULL,&ThreadAttribute);
  
}









